package org.example.codegenerate.modelext;

import lombok.extern.slf4j.Slf4j;
import org.example.codegenerate.entity.ColumnVo10;
import org.example.codegenerate.entity.TableVo10;


import java.util.List;

@Slf4j
public class ValidatAllParameter {
    public static void execute(OneTableEngineeDomainWithTree oneTableEngineeDomainWithTree, TableVo10 tableVo, List<ColumnVo10> newaddedColumns, List<ColumnVo10> originalColumns, String getdestinationOutPutDirPath, String templatePath, String stylePath) throws Exception{

        log.info("开始进入验证参数的阶段");
        System.out.println("------------开始进入验证参数的阶段---------   ");
        boolean tablevo10equal=oneTableEngineeDomainWithTree.getTableVo().equals(tableVo);
        System.out.println("tablevoequal:"+tablevo10equal);
        System.out.println("------------new added ---------字段间隔");
        List<ColumnVo10> newaddedColumsfromtree=oneTableEngineeDomainWithTree.getNewaddedColumns();
        for(ColumnVo10 colfromtreeeach:newaddedColumsfromtree){
            if(!newaddedColumns.contains(colfromtreeeach)){
                System.out.println("colfromtreeeach:"+colfromtreeeach.getFieldName()+"__"+colfromtreeeach.toString());
                System.out.println("columvo10Corrent:"+"__"+newaddedColumns.stream().filter(x->x.getFieldName().equals(colfromtreeeach.getFieldName())).findFirst().toString());
                System.out.println("------------字段间隔");
                //log.info(colfromtreeeach.toString());
            }
        }
        System.out.println("------------Orginal---------字段间隔");
        List<ColumnVo10> originalColumsfromtree=oneTableEngineeDomainWithTree.getOriginalColumns();
        for(ColumnVo10 colfromtreeeach:originalColumsfromtree){
            if(!originalColumns.contains(colfromtreeeach)){
                System.out.println("colfromtreeeach:"+colfromtreeeach.getFieldName()+colfromtreeeach.toString());
                System.out.println("columvo10Corrent:"+originalColumns.stream().filter(x->x.getFieldName().equals(colfromtreeeach.getFieldName())).findFirst().toString());
                System.out.println("------------字段间隔");
                //log.info(colfromtreeeach.toString());
            }
        }

        System.out.println("outputpathequal:"+oneTableEngineeDomainWithTree.getDestinationOutPutDirPath().equals(getdestinationOutPutDirPath));
        System.out.println("templatePathqual:"+oneTableEngineeDomainWithTree.getTemplatepath().equals(templatePath));
        System.out.println("stylePathequal:"+oneTableEngineeDomainWithTree.getStylepath().equals(stylePath));


    }
}
